<?php 
class BannersController extends DomController {
	
	public function showBanners() {
		
		if( $_GET['highlight'] )
			$r = Banner::initLocationsHighlight('main');
		else
			$r = Banner::initPublicBanners('main', $this->getUrl('banner/') );

		foreach( $r as $key => $html ) {
			$this->view->$key = $html;
		}
	}
	
	public function banner( $id ) {
		if( $banner = Banner::load( $id ) )
			$banner->click();
	}
	
	public function setup() {
		$this->view->pageTitle = 'Banners module sample';
		
		$this->showBanners();
	}

}
?>